<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>08-事件绑定</title>

</head>
<body>
    <input type="button" value="普通函数" onclick="method01()"> <br>
    <input type="button" value="匿名函数" id="btn"> <br>
</body>

<script>

    function method01() {
        console.log("hello")

    }

</script>

<script>

    var btn=document.getElementById("btn");
    btn.onclick=function () {
        console.log("hello2")

    }

</script>


</html>